package com.one.service;

import com.one.bean.Activity;
import com.one.bean.Category;
import com.one.bean.Product;
import com.one.util.RequestReturn;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author: tzy
 * @create: 2022/1/20
 * @FileName: IndexService
 * @Description: 主页展示业务层接口
 */
@FeignClient(name = "street-tzy")
public interface IndexService {
    /**
     * @author: tzy
     * @date: 2022/1/20
     * @return: com.one.util.RequestReturn<java.util.List<com.one.bean.ProductView>>
     * @Description: 查询指定分类的热销商品
     */
    @GetMapping("/homePage/hotProducts")
    RequestReturn<List<Product>> queryHotProducts(@RequestParam("categoryFirst") Integer categoryFirst);

    /**
     * @author: tzy
     * @date: 2022/1/20
     * @return: com.one.util.RequestReturn<java.util.List<com.one.bean.Category>>
     * @Description: 根据商品一级分类，查询一二级分类的名称
     */
    @GetMapping("/homePage/categories")
    RequestReturn<List<Category>> queryCategories(@RequestParam("categoryFirst") Integer categoryFirst);

    /**
     * @author: tzy
     * @date: 2022/1/20
     * @return:
     * @Description: 查询商品对应分类的新品
     */
    @GetMapping("/homePage/products")
    RequestReturn<List<Product>> queryNewProducts(@RequestParam("categoryFirst") Integer categoryFirst);

    /**
     * @author: tzy
     * @date: 2022/1/20
     * @return:
     * @Description: 首页限时，秒杀，热销跳转
     */
    @GetMapping("/homePage/moduleToJump")
    RequestReturn<List<Activity>> queryActivities();

}
